<template>
	<view>
		<view class="banner">
			<view class="status">已支付</view>
			<view class="desc">退款金额将会在三天内原路返回支付账号，请注意查看</view>
		</view>
		<view class="order-item">
			<view class="title">
				<text>粤运能源皇岗加油站</text>
				<text class="status">已支付</text>
			</view>
			<view class="station-item">
				<view class="info">
					<view class="title">粤运能源皇岗加油站</view>
					<view class="address">罗湖区人民南路3026号28A</view>
					<view class="detail">
						<view class="huaxian">汽油</view>
						<view class="huaxian">95#</view>
					</view>
				</view>
			</view>
			<view class="price">￥313.2</view>
		</view>
		<view class="order-info">
			<view class="title">订单信息</view>
			<view class="info-item">
				<view class="lable">订单号：</view>
				<view class="value">SLZC1879541212333510</view>
				<view class="btn" @click="copy('SLZC1879541212333510')">复制订单号</view>
			</view>
			<view class="info-item">
				<view class="lable">支付时间：</view>
				<view class="value">2020/11/01 10:25</view>
			</view>
			<view class="info-item">
				<view class="lable">下单时间：</view>
				<view class="value">2020/11/01 10:25</view>
			</view>
			<view class="info-item">
				<view class="lable">购买手机号：</view>
				<view class="value">17688888888</view>
			</view>
			<view class="info-item">
				<view class="lable">下单时间：</view>
				<view class="value">2020/11/01 10:25</view>
			</view>
			<view class="line"></view>
			<view class="info-item">
				<view class="lable">订单总价：</view>
				<view class="value">￥12306</view>
			</view>
			<view class="info-item">
				<view class="lable">优惠金额：</view>
				<view class="value">-￥888</view>
			</view>
			<view class="info-item">
				<view class="lable">支付方式：</view>
				<view class="value">微信支付</view>
			</view>
			<view class="info-item">
				<view class="lable">服务费：</view>
				<view class="value">￥2</view>
			</view>
			<view class="info-item">
				<view class="lable">实付金额：</view>
				<view class="value">￥364</view>
			</view>
		</view>
		<view class="op-btn" @click="refuse">
			申请退款
		</view>
		<view class="op-btn" @click="del">
			删除订单
		</view>
		<u-modal v-model="show" :mask-close-able="true" title="提示" show-cancel-button confirm-color="#FF4141" :content="content"
		 @confirm="confirm"></u-modal>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				content: '确定删除该订单吗？',
				opType: 'del'
			}
		},
		methods: {
			copy(data) {
				uni.setClipboardData({
					data
				})
			},
			confirm() {
				this.show = false
				if (this.opType == 'refuse') {
					uni.navigateTo({
						url: './orderRefuse'
					})
				}
			},
			del() {
				this.content = '确定删除该订单吗？'
				this.opType = 'del'
				this.show = true
			},
			refuse() {
				this.content = '确定申请退款吗？'
				this.opType = 'refuse'
				this.show = true
			}
		}
	}
</script>

<style lang="scss">
	.banner {
		width: 100%;
		height: 300rpx;
		background: linear-gradient(180deg, #2D7AFE 0%, #5694FF 100%);
		padding: 40rpx;
		color: #FFFFFF;

		.status {
			font-size: 38rpx;
		}

		.desc {
			color: #FFFFFF;
			margin-top: 10rpx;
			font-size: 28rpx;
		}
	}

	.order-item {
		background-color: #FFFFFF;
		padding: 20rpx;
		width: 95%;
		margin: 0 auto;
		margin-top: -120rpx;
		border-radius: 20rpx;

		.title {
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #333333;

			.status {
				color: #666666;
			}
		}

		.station-item {
			border-radius: 20rpx;
			background-color: #FFFFFF;
			display: flex;
			align-items: center;
			justify-content: flex-start;
			margin-top: 20rpx;

			.image {
				width: 120rpx;
				height: 120rpx;
			}

			.info {
				display: flex;
				align-items: flex-start;
				justify-content: space-between;
				flex-direction: column;
				margin-left: 20rpx;

				.title {
					color: #333333;
					font-weight: bold;
					margin-bottom: 10rpx;
				}

				.address {
					color: #999999;
					font-weight: 400;
					margin-bottom: 10rpx;
				}

				.detail {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.huaxian {
						color: #9f9f9f;
						font-size: 26rpx;
						margin-left: 10rpx;
					}
				}
			}

		}

		.price {
			text-align: right;
			width: 100%;
			color: #333333;
			font-weight: bold;
			margin-top: 20rpx;
		}
	}

	.order-info {
		background-color: #FFFFFF;
		padding: 20rpx;
		width: 95%;
		margin: 0 auto;
		margin-top: 20rpx;
		border-radius: 20rpx;

		.title {
			color: #333;
			font-size: 32rpx;
			font-weight: bolder;
			padding: 20rpx 0;
		}

		.line {
			width: 100%;
			height: 0;
			border-bottom: 2rpx solid #f4f4f4;
			margin: 10rpx 0;
		}

		.info-item {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 10rpx 0;

			.btn {
				border-radius: 10rpx;
				padding: 5rpx 10rpx;
				color: #2D7AFE;
				border: 2rpx solid #2D7AFE;
				font-size: 24rpx;
			}

			.label {
				color: #666;
			}

			.value {
				color: #333;
			}
		}
	}

	.op-btn {
		width: 95%;
		margin: 20rpx auto;
		background-color: #FFFFFF;
		border-radius: 15rpx;
		color: #333;
		text-align: center;
		padding: 20rpx;
	}
</style>
